@extends('layouts.home-marster')
@section('first-content')
        {{--左侧--}}
        <div class="contents col-md-8 col-xs-8 col-sm-8">
            <div class="row">
                <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
                    <!-- Indicators -->
                    <ol class="carousel-indicators">
                
                        <li data-target="#carousel-example-generic" data-slide-to="1"></li>
                        <li data-target="#carousel-example-generic" data-slide-to="2"></li>
                        <li data-target="#carousel-example-generic" data-slide-to="3"></li>
                    </ol>
                    <!-- Wrapper for slides -->
                    <div class="carousel-inner" role="listbox">
             
                        <div class="item">
                            <img class="first-icons" name="lbt_img" style="width:780px;height:330px;" src="{{asset('/box/1.png')}}" alt="...">
                        </div>
                        <div class="item">
                            <img class="first-icons" name="lbt_img" style="width:780px;height:330px;" src="{{asset('/box/2.png')}}" alt="...">
                        </div>
                        <div class="item active">
                            <img class="first-icons" name="lbt_img" style="width:780px;height:330px;" src="{{asset('/box/3.png')}}" alt="...">
                        </div>
                    </div>
                </div>

                <!-- Controls -->
                <a style="margin-top:10px" class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
                    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                    <span class="sr-only">Previous</span>
                </a>
                <a style="margin-top:10px" class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
                    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                    <span class="sr-only">Next</span>
                </a>

            <div class="recommend-course">
                <h2 style="font-size:15px"><b>推荐课程</b></h2>
                {{--文章列表--}}
                <div class="article-box">
                    @if(empty(count($user)))
                        <div style="border-top:1px solid #ccc;line-height:100px;text-align:center;font-size:20px;" colspan="7">暂无数据</td>
                            @else
                                @foreach($user as $k)
                                    <div id="item">
                                        <div class="itemc">
                                            <div class="article-content">
                                                <div class="photo-box">
                                                    <a href="{{url('zjxhome/go_course/'.$k->id.'/b')}}" target="_blank">
                                                        <img style="width:192px;height:108px;" src="{{asset('/image/home/'.$k->icon)}}">
                                                    </a>
                                                </div>
                                                <div class="intro-box" >
                                                    <h3><a href="{{url('zjxhome/go_course/'.$k->id.'/b')}}" target="_blank" style="color: #3D495F;"><b>{{$k->title}}</b></a></h3>
                                                    <p class="intro" style=" width:480px;height:60px;overflow: hidden;"><a href="{{url('zjxhome/go_course/'.$k->id.'/b')}}" target="_blank" >{!! $k->dist !!}</a></p>
                                                </div>
                                            </div>
                                            <div class="article-bottom">
                                                <span class="author pic32"><span class="circle"></span><img src="{{asset('image/course/'.$k->img)}}">{{$k->nickname}}</span>
                                                <span class="data">{{date('Y-m-d h:i:s',$k->uptime)}}</span>
                                            </div>
                                        </div>
                                    </div>
                                @endforeach
{{--                                    {{$users->links()}}--}}
                            @endif

                            <div>
                                <p class="more-bottom"><a href="{{url('zjxhome/course')}}">加载更多</a></p>
                            </div>
                        </div>
                </div>
        </div>
        </div>
        {{--右侧--}}
        <div id="main-right" class="col-md-4 col-xs-4 col-sm-4">
            {{--我的专区--}}
            <div class="com-sections">
                <h4>我的专区</h4>
                {{--未登录显示--}}
                <div class="nologin-box">
                    <div class="author-box" style="border-top:1px solid #BEC0CD;">
                        {{--头像--}}
                        <span style="font-size:25px;margin-left:30px;margin-right:20px;padding:10px;color:#ccc" class="glyphicon glyphicon-user" aria-hidden="true"></span>
                        {{--信息--}}
                        <div class="right">
                            <p class="info"><b>
                                    @if(session('nickname'))
                                    <span style="color:red;">
                                    {{session('nickname')}}
                                    </span>
                                        ,你好
                                    @else
                                      Hi,你好
                                    @endif
                                </b></p>
                            <p class="jifen" style="color: #9EA6B4;">欢迎来到作家专区</p>
                        </div>
                    </div>
                </div>
                <div class="login-box">
                 @if(session('nickname'))
                    <a href="{{url('huweize/home/userHome')}}" >进入我的专区</a>
                    @else
                        <a>未登入请先登入再进入作家专区</a>
                     @endif
                </div>
            </div>
            <div class="com-section news-section">
                <h2 class="sec-ttl">最新资讯</h2>
                <div class="news-list">
                    @if(!empty($consult))
                    @foreach($consult as $k)
                    <div class="item">
                        <p class="title"><a href="" target="_blank">{{$k->title}}</a></p>
                        <p class="time">{{date('Y-m-d',$k->addtime)}}</p>
                        <p class="intro" style="overflow: hidden;max-height: 72px;text-overflow: ellipsis;white-space: nowrap;"><a href="" target="_blank">{{$k->text}}</a></p>
                    </div>
                    @endforeach
                        @endif
                </div>
                <p class="more-bottom"><a href="{{url('zjxhome/consult')}}">更多资讯</a></p>
            </div>
        </div>
@endsection
